import request from '@/utils/request'
import { addLocale } from 'core-js'

// 商品管理
// 新增策略
export const addlist = data => request.post(' /api/vm-service/policy', data)

// 获取列表
export const tackcommodity = (innerCodeList, policyId) => request.get('/api/vm-service/policy', {
  params: { innerCodeList, policyId }
})

// 删除列表
// export const delcomList = id => request.delete(`/api/vm-service/policy/${id}`)

export function delcomList (policyId) {
  return request({
    url: `/api/vm-service/policy/${policyId}`,
    method: 'delete'
  })
}

// 修改策略
export const getxiugai = (policyName, discount) => request.put(`/api/vm-service/policy/${policyId}`, {
  params: { policyName, discount }
})

// 策略搜索)
export const searchbtn = params => request.get('/api/vm-service/policy/search', { params })
// 新增策略
export const addcl = data => request.post('/api/vm-service/policy', data)
// 修改策略
export const editcl = data => request.put(`/api/vm-service/policy/${data.policyId}`, data)
